package com.cssy.yd.logic.dao.impl;

import com.cssy.yd.logic.dao.LogicSoWarefreezedealItemBatchDAO;
import com.cssy.yd.logic.entity.LogicSoWareItemBatchDO;
import com.cssy.yd.logic.entity.LogicSoWarefreezedealItemBatchDO;
import com.plat.helper.SearchConditions;

import java.util.List;

import org.springframework.dao.DataAccessException;
import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;

/**
 * ��ݷ��ʶ���ʵ����
 * @since 2013-11-06
 */
public class LogicSoWarefreezedealItemBatchDAOImpl extends SqlMapClientDaoSupport implements LogicSoWarefreezedealItemBatchDAO {

    /**
     * �������
     * @param logicSoWarefreezedealItemBatchDO
     * @return ������ݵ�����
     */
    public String insertLogicSoWarefreezedealItemBatchDO(LogicSoWarefreezedealItemBatchDO logicSoWarefreezedealItemBatchDO) {
        Object ID = getSqlMapClientTemplate().insert("LogicSoWarefreezedealItemBatch.insert", logicSoWarefreezedealItemBatchDO);
        return (String) ID;
    }

    /**
     * ͳ�Ƽ�¼��
     * @param logicSoWarefreezedealItemBatchDO
     * @return ����ļ�¼��
     */
    public Integer countLogicSoWarefreezedealItemBatchDOByExample(LogicSoWarefreezedealItemBatchDO logicSoWarefreezedealItemBatchDO) {
        Integer count = (Integer) getSqlMapClientTemplate().queryForObject("LogicSoWarefreezedealItemBatch.countByDOExample", logicSoWarefreezedealItemBatchDO);
        return count;
    }

    /**
     * ���¼�¼
     * @param logicSoWarefreezedealItemBatchDO
     * @return ��Ӱ�������
     */
    public Integer updateLogicSoWarefreezedealItemBatchDO(LogicSoWarefreezedealItemBatchDO logicSoWarefreezedealItemBatchDO) {
        int result = getSqlMapClientTemplate().update("LogicSoWarefreezedealItemBatch.update", logicSoWarefreezedealItemBatchDO);
        return result;
    }

    /**
     * ��ȡ�����б�
     * @param logicSoWarefreezedealItemBatchDO
     * @return �����б�
     */
    @SuppressWarnings("unchecked")
    public List<LogicSoWarefreezedealItemBatchDO> findListByExample(LogicSoWarefreezedealItemBatchDO logicSoWarefreezedealItemBatchDO) {
        List<LogicSoWarefreezedealItemBatchDO> list = getSqlMapClientTemplate().queryForList("LogicSoWarefreezedealItemBatch.findListByDO", logicSoWarefreezedealItemBatchDO);
        return list;
    }

    /**
     * ��������ȡlogicSoWarefreezedealItemBatchDO
     * @param id
     * @return logicSoWarefreezedealItemBatchDO
     */
    public LogicSoWarefreezedealItemBatchDO findLogicSoWarefreezedealItemBatchDOByPrimaryKey(String id) {
        LogicSoWarefreezedealItemBatchDO logicSoWarefreezedealItemBatchDO = (LogicSoWarefreezedealItemBatchDO) getSqlMapClientTemplate().queryForObject("LogicSoWarefreezedealItemBatch.findByPrimaryKey", id);
        return logicSoWarefreezedealItemBatchDO;
    }

    /**
     * ɾ���¼
     * @param id
     * @return ��Ӱ�������
     */
    public Integer deleteLogicSoWarefreezedealItemBatchDOByPrimaryKey(String id) {
        Integer rows = (Integer) getSqlMapClientTemplate().delete("LogicSoWarefreezedealItemBatch.deleteByPrimaryKey", id);
        return rows;
    }

    @Override
    public List<LogicSoWarefreezedealItemBatchDO> find(SearchConditions scs) throws DataAccessException{
		
   		List<LogicSoWarefreezedealItemBatchDO> list = getSqlMapClientTemplate().queryForList("LogicSoWarefreezedealItemBatch_ex.find", scs);
   		   return list;
    }
	@Override
    public Integer count(SearchConditions scs) throws DataAccessException {		
		 Integer count = (Integer) getSqlMapClientTemplate().queryForObject("LogicSoWarefreezedealItemBatch_ex.count", scs);
  	      return count;
  	}
	
	@Override
    public List<LogicSoWarefreezedealItemBatchDO> findBywfdId(String id) throws DataAccessException{
   		List<LogicSoWarefreezedealItemBatchDO> list = getSqlMapClientTemplate().queryForList("LogicSoWarefreezedealItemBatch_ex.findbywfdId", id);
   		   return list;
    }
	@Override
	public Integer deleteBywfdId(String id) throws DataAccessException{
        Integer rows = (Integer) getSqlMapClientTemplate().delete("LogicSoWarefreezedealItemBatch_ex.deleteBywfdId", id);
        return rows;
    }
}